CREATE TABLE [dbo].[TDDIRE_CLIE]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_CLIE] [dbo].[TD_VC_020] NOT NULL,
[TI_DIRE] [dbo].[TD_VC_003] NOT NULL,
[DE_DIRE] [dbo].[TD_VC_100] NULL,
[DE_REFE] [dbo].[TD_VC_100] NULL,
[CO_UBIC_GEOG] [dbo].[TD_VC_006] NULL,
[DE_CIUD] [dbo].[TD_VC_020] NULL,
[DE_DPTO] [dbo].[TD_VC_020] NULL,
[CO_PAIS] [dbo].[TD_VC_003] NULL,
[NU_TLF1] [dbo].[TD_VC_020] NULL,
[NU_TLF2] [dbo].[TD_VC_020] NULL,
[NU_FAXS] [dbo].[TD_VC_020] NULL,
[DE_DIRE_MAIL] [dbo].[TD_VC_050] NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TDDIRE_CL__CO_US__7F16D496] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TDDIRE_CL__FE_US__000AF8CF] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TDDIRE_CL__CO_US__00FF1D08] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TDDIRE_CL__FE_US__01F34141] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDDIRE_CLIE] ADD CONSTRAINT [PK__TDDIRE_C__03A4946B465E457E] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_CLIE], [TI_DIRE]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDDIRE_CLIE] ADD CONSTRAINT [FK__TDDIRE_CLIE__455512AC] FOREIGN KEY ([CO_EMPR], [CO_CLIE]) REFERENCES [dbo].[TMCLIE_TESO] ([CO_EMPR], [CO_CLIE])
GO
ALTER TABLE [dbo].[TDDIRE_CLIE] ADD CONSTRAINT [FK__TDDIRE_CL__TI_DI__4460EE73] FOREIGN KEY ([TI_DIRE]) REFERENCES [dbo].[TTTIPO_DIRE] ([TI_DIRE])
GO
